﻿using NUnit.Framework;
using Ploeh.AutoFixture;
using Wolfpack.Contrib.Publishers.Email;
using Wolfpack.Core;

namespace Wolfpack.Contrib.Tests.Publishers.Email
{
  [TestFixture]
  public class HtmlSmtpUtilityTests
  {
    Fixture _fixture;

    [SetUp]
    public void Initialize()
    {
      _fixture = new Fixture();
    }

    [Test]
    public void Send_should_work_with_trailing_semicolon()
    {
      var config = new EmailConfiguration
      {
        Enabled = true,
        FriendlyId = "Email",
        FromAddress = "Wolfpack@test.com",
        FromName = "Wolfpack Notifications",
        SmtpHost = "localhost",
        Port = 25,
        ToAddress = "notificationAddress@test.com;",
        Environment = "Test",
        MailSubject = "Wolfpack Unit Test",
        TemplatePath = "EmailPublisherTemplates",
      };

      var smtpUtility = new HtmlSmtpUtility(config);
      var agentData = _fixture.Create<NotificationModel>();
      smtpUtility.Send(agentData);
    }
  }
}
